//
//  Creator.cpp
//  AntSimulation
//
//  Created by Robert Mayr on 24.10.12.
//  Copyright (c) 2012 Robert Mayr. All rights reserved.
//

#include "Creator.h"

Creator Creator::instance;
int Creator::nItemsCreated = 0;
int Creator::nAntsCreated = 0;
int Creator::nAnthillsCreated =0;
int Creator::nFoodCreated =0;
int Creator::nAreasCreated =0;

Creator* Creator::getInstance()  {
	return (&instance);
}

void Creator::ItemCreated() {
	nItemsCreated++;
}

Creator::Creator() {}

Creator::~Creator() {}

Ant* Creator::Create_Ant() {
	Creator::ItemCreated();
	nAntsCreated++;
	Ant* pAnt = new Ant();
	pAnt->setName("Ant");
	pAnt->setNumber(nAntsCreated);
    return pAnt;
}

Food* Creator::Create_Food() {
	Creator::ItemCreated();
	nFoodCreated++;
	Food* pFood = new Food();
	pFood->setName("Food");
	pFood->setNumber(nFoodCreated);
    return pFood;
}

Anthill* Creator::Create_Anthill() {
	Creator::ItemCreated();
	nAnthillsCreated++;
	Anthill* pAnthill = new Anthill();
	pAnthill->setName("Anthill");
	pAnthill->setNumber(nAnthillsCreated);
    return pAnthill;
}


Area* Creator::Create_Area() {
	Creator::ItemCreated();
	nAreasCreated++;
	Area* pArea = new Area();
	pArea->setName("Area");
	pArea->setNumber(nAreasCreated);
    return pArea;
}
